<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSettingMediasTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('setting_medias', function (Blueprint $table) {
            $table->id();
            $table->integer('setting_id')->unsigned()->comment('系统配置setting表id');
            $table->smallInteger('default_size')->unsigned()->default(1024)->comment('用户素材库大小');
            $table->tinyInteger('is_check')->default(1)->unsigned()->comment('用户上传素材是否需要审核');
            $table->smallInteger('duration')->default(30)->unsigned()->comment('视频时长限制');
            $table->tinyInteger('transcoding')->default(0)->unsigned()->comment('视频是否转码');
            $table->char('storage',7)->default('default')->comment('文件存储方式，default=默认，al=阿里云存储,qi=七牛云存储,tx=腾讯云存储');
            $table->text('qn')->nullable()->comment('七牛云配置');
            $table->text('al')->nullable()->comment('阿里云存储配置');
            $table->text('tx')->nullable()->comment('腾讯云存储配置');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('setting_medias');
    }
}
